home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "AddIn"
- ' Code for Addin.bas (Module)
- ' By J.M.Goebel
- ' This Code is Freeware if you use this code to develop new Application
- ' it may only be distributed as Freeware!
-
-
-
- Option Explicit
- Declare Function WritePrivateProfileString& Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal AppName$, ByVal KeyName$, ByVal keydefault$, ByVal FileName$)
- Private mStatus As String ' Status-Info fⁿr Fehlerbehandlung
-
- '====================================================================
- 'Diese Prozedur sollte vom Direktfenster aus ausgefⁿhrt werden
- ' damit diese Amwendung korrekt zu VBADDIN.INI hinzugefⁿgt wird,
- ' mⁿssen Sie den Namen im zweiten Argument entsprechend dem
- ' Projektnamen anpassen.
- '====================================================================
- Sub AddToINI()
- Dim ErrCode As Long
- ErrCode = WritePrivateProfileString("Add-Ins32", "CodeCompleter.Connect", "0", "vbaddin.ini")
- End Sub
-
- Public Property Let Status(Value As String)
- mStatus = Value
-
- 'frmAddIn.StatusBar1.Panels("Status") = mStatus
-
- End Property
-
-
-
- Public Function EraseSpaces(ByVal s As String) As String
- ' l÷scht alle Chars < 33 aus dem String und ersetzt sie
- ' durch einen Underscore
-
- Dim i%
-
-
-
- For i = 1 To Len(s)
- If Asc(Mid$(s, i, 1)) < 33 Then
- Mid$(s, i, 1) = "_"
- End If
- Next i
-
- EraseSpaces = s
-
-
-
- End Function
-
- Public Sub Replace(ByRef strSearch$, strFind$, strReplace$, Optional Start%, Optional HowOften%)
- Dim find1%, strLeft$, strRight$
- find1 = 1
-
- If Start > Len(strSearch) Then Err.Raise vbObjectError, "Replace", "Start groesser als StrSearch"
- If Start > 0 Then find1 = Start
-
- Do
- find1% = InStr(find1, strSearch, strFind)
- If find1% = 0 Then Exit Do
- strLeft = Left$(strSearch, find1 - 1)
- strRight = Right$(strSearch, Len(strSearch) - Len(strFind) - find1 + 1)
- strSearch = strLeft + strReplace + strRight
- HowOften = HowOften - 1
- If HowOften = 0 Then Exit Do
- Loop
-
- End Sub
-